/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.gingresos.start;

import java.awt.Color;
import java.awt.Component;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

/**
 *
 * @author avbravo
 */
public class MyTableRendered extends DefaultTableCellRenderer {

    public Component getTableCellRendererComponent(JTable table, Object value, boolean selected, boolean focused, int row, int column) {
        setEnabled(table == null || table.isEnabled()); // see question above 
//Para usuarlo
//        TableColumn col = jTable.getColumnModel().getColumn(0); 
//col.setCellRenderer(new MyTableRendered());
        if ((row % 2) == 0) {
            setBackground(Color.green);
        } else {
            setBackground(null);
        }
       

        super.getTableCellRendererComponent(table, value, selected, focused, row, column);

        return this;
    }
}
